package com.connector.base.connection.channel;

import io.netty.channel.Channel;

import java.util.Objects;

public class NettyChannelSocketChannel implements SocketChannel
{
    private final Channel channel;

    public NettyChannelSocketChannel(final Channel channel) {
        this.channel = channel;
    }

    @Override
    public boolean equals(final Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || this.getClass() != o.getClass()) {
            return false;
        }
        final NettyChannelSocketChannel that = (NettyChannelSocketChannel)o;
        return Objects.equals(this.channel, that.channel);
    }

    @Override
    public int hashCode() {
        return Objects.hash(this.channel);
    }

    public Channel getChannel() {
        return this.channel;
    }
}
